// 依赖更新时执行
import { useEffect, useRef } from 'react';

const useUpdateEffect = (callback, deps = []) => {
    const isFirst = useRef(true);
    useEffect(() => {
        if (!isFirst.current) {
            return callback();
        }
        isFirst.current = false;
    }, deps);
};

export default useUpdateEffect;
